package Demo;

public class Animal {
    public String name;
    public int age;
    public void eat(){
        System.out.println(this.name+"正在吃饭");
    }
    static{
        System.out.println("static :: Animal{}");
    }
    {
        System.out.println("实例代码块()……");
    }
    public Animal(String name,int age){
        this.name =name;
        this.age =age;
        System.out.println("Animal()...");
    }

    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}